﻿@section Styles{

}

@section Scripts{
    <script type="text/javascript">
        let app = new Vue({
            el: "#app",
            data: function () {
                return {
                    grid: 24,
                    oldPassword: null,
                    newPassword: null,
                    qrPassword: null
                }
            },
            created: function () {

            },
            mounted: function () {

            },
            methods: {
                save: function () {
                    let _this = this;
                    let path = "/Admin/ChangePassword/SaveForm";

                    hzyAdmin.httpPost(path, { 
                        oldPassword:_this.oldPassword,
                        newPassword: _this.newPassword,
                        qrPassword:_this.qrPassword 
                   }, function (r) {
                        if (r.code !== 1) return;
                        hzyAdmin.alert('变更成功!即将退出重新登录', '成功');
                        setTimeout(function () {
                            top.window.location = '/Admin/Login/Out';
                        }, 500);
                    });
                }
            }
        });
    </script>
}

<div class="m-20" id="app">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-4 offset-sm-4">
                <el-card>
                    <div class="col-sm-12">
                        <h4 class="example-title">旧密码</h4>
                        <input type="text" class="form-control" placeholder="请输入 旧密码" v-model="oldPassword"
                               autocomplete="off"/>
                    </div>
                    <div class="col-sm-12">
                        <h4 class="example-title">新密码</h4>
                        <input type="text" class="form-control" placeholder="请输入 新密码" v-model="newPassword"
                               autocomplete="off"/>
                    </div>
                    <div class="col-sm-12">
                        <h4 class="example-title">确认密码</h4>
                        <input type="text" class="form-control" placeholder="请输入 确认密码" v-model="qrPassword"
                               autocomplete="off"/>
                    </div>

                    <div class="col-sm-12 mt-20 text-center">
                        <button class="btn btn-primary" @@click="save">保存</button>
                    </div>
                </el-card>
            </div>
        </div>

    </div>
</div>